package com.wectrls.common.utils;

import java.util.Random;

public class RandomNotes {
    /**
     * 生成随机的4位数，短信验证码
     * @return
     */
    public String getMsgCode() {
        int n = 4;
        StringBuilder code = new StringBuilder();
        Random ran = new Random();
        for (int i = 0; i < n; i++) {
            code.append(Integer.valueOf(ran.nextInt(10)).toString());
        }
        return code.toString();
    }
}
